/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.icatportal.client.mvc;

import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;
import org.icatportal.client.AppEvents;

/**
 *
 * @author ll56
 */
public class MyDataController  extends Controller {

  private MyDataFolderView folderView;
  private MyDataView taskView;

  public MyDataController() {
    registerEventTypes(AppEvents.Init);
    registerEventTypes(AppEvents.MyData);
  }

  @Override
  public void initialize() {
    super.initialize();
    folderView = new MyDataFolderView(this);
    taskView = new MyDataView(this);
  }

  public void handleEvent(AppEvent event) {
    if (event.type == AppEvents.Init) {
      forwardToView(folderView, event);
    }
    if (event.type == AppEvents.MyData) {
      forwardToView(taskView, event);
    }
  }

}

